package org.mybatis.generator.ext;

public class TableXmlEntityCreate {

	private static String[] tables = { "account_flow", "activity", "activity_product", "activity_property",
			"activity_record", "admin_menu", "admin_message", "admin_role", "admin_role_menu", "admin_user",
			"area_domain", "cartoon_category", "cartoon_content", "data_user", "employee_relations_mapping",
			"exchange_code", "financial_management", "gift", "gift_detail", "gift_exchange_info", "gift_product",
			"info_banner", "info_big_banner", "info_client_banner", "info_client_feedback", "info_client_version",
			"info_media", "info_news", "info_notice", "inserttest", "lingbao_activity_banner", "lingbao_address",
			"lingbao_exchange_info", "lingbao_gift", "lingbao_gift_cart", "lingbao_gift_type", "lingbao_lottery_ratio",
			"lingbao_lottery_type", "lingbao_sign", "lingbao_sign_record", "lingbao_supplier", "lingqian_tmp",
			"loan_company", "loan_personal", "notice", "num", "payment_card_limit", "payment_partition",
			"pay_enterprise", "prefix_bank", "product", "product_active_rate", "product_category",
			"product_category_fix_rate", "product_float_net_value", "product_img", "product_param", "product_recommend",
			"product_statistics", "product_submit", "recharge_cash_statistics", "recharge_limit", "redeem_fail_flow",
			"regist_request_no", "sell_auto_return", "sell_batch", "sell_batch_info", "support_bank",
			"takeheart_category", "takeheart_fix_rate", "takeheart_sell_pay", "takeheart_summary_day",
			"takeheart_transaction_flow", "takeheart_user_statistics", "trading", "trading_fix_info",
			"trading_fix_info_copy", "trading_float_info", "trading_manage_cost", "unband_bankcard", "unfreeze_flow",
			"users", "users_account", "users_ask", "users_bank", "users_financing", "users_message", "users_properties",
			"user_reconciliation", "usres_degree", "wallet_account_day", "wallet_auto_pay", "wallet_bigsell_constr",
			"wallet_interest_detail", "wallet_sell_pay", "wallet_summary_day", "wallet_transaction_flow",
			"data_syn_wenying_flow", "ermid", "ermida", "ermidb", "newida", "newidaa", "newidb", "referral_all",
			"referral_all_old", "referral_eid", "referral_nid", "user_year_financialmoney" };

	public static void main(String[] args) {
		createTableXml();
	}

	private static void createTableXml() {
		for (int i = 0; i < tables.length; i++) {
			String table = tables[i];
			System.out.println(concatString(table));
		}
	}

	// <table domainObjectName="AccountFlow" tableName="account_flow"></table>
	private static String concatString(String table) {
		StringBuffer sbt = new StringBuffer();
		sbt.append("<table tableName=\"" + table + "\"></table>");
		return sbt.toString();
	}

	/**
	 * 转换
	 * 
	 * @param table
	 * @return
	 */
	private static String convertTableName(String table) {
		// 转换成小写
		table = table.toLowerCase();
		// 截取
		String[] name = table.split("_");
		StringBuffer convert = new StringBuffer();

		for (int i = 0; i < name.length; i++) {
			// 截取第一个字母转换成大写
			convert.append(name[i].substring(0, 1).toUpperCase());
			convert.append(name[i].substring(1));
		}
		return convert.toString();
	}
}
